/**
 * 消息表
 */
var mongoose = require('mongoose');
var constant = require('../../config/constant');
var BaseSchema = require('./base_schema');

var messageSchema = new BaseSchema({
    sender: {type: String},                                           // 消息发送人ID
    recipient: {type: String},                                        // 消息接收人ID
    content: {type: String},                                          // 消息内容
    readStatus: {type: Number, default: constant.ReadStatus.UNREAD}, // 接收人是否已读该消息
    type: {type: Number}                                              // 类型(0: 医生问题消息; 1: 医生系统消息; 2: 用户系统消息)
});
module.exports = mongoose.model('message', messageSchema);
